package com.mfp.java.testYou.ui.tags;

import javax.servlet.jsp.tagext.BodyTagSupport;

import com.mfp.java.testYou.core.AppContext;

public class AdminOnlyTag extends BodyTagSupport {

	private static final long serialVersionUID = 3530409656181484021L;

	@Override
	public int doStartTag() {
		if (AppContext.getUserSession(this.pageContext.getRequest()).isAdmin()) {
			return EVAL_BODY_INCLUDE;
		} else {
			return SKIP_BODY;
		}
	}
}
